package part;
import java.awt.Color;
import java.awt.Graphics2D;


import mainGame.ProgBob;


public class PartString extends Part
{
    private String text;

	public PartString (ProgBob progBob, double x, double y, String text, double speed)
    {
        super(progBob, x, y, null, speed);
        this.text = text;
    }

    @Override
    public void draw (Graphics2D context)
    {
        if (getLife() < 0.25)
        {
            context.setFont(progBob.getFnts()[(int)(4 * getLife() * 10)]);
        }
        else
        {
            context.setFont(progBob.getFnts()[9]);
        }
        context.setColor(Color.WHITE);
        context.drawString(text, (int)getX(), (int)getY());
    }
    public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

}
